Diagonalization and applications
Lecture 28
Recap
$$ % Colors
% Coordinate vectors and matrices
% Common sets
% Abstract vector symbols
% Norms / absolute value
% Optional: dot product spacing (looks nicer in slides)
% Operators $$
Eigenvalues and eigenvectors
Let \(A\) be an \(n\times n\) matrix. If a nonzero vector \(\vec{u}\in\mathbb{R}^n\) satisfies \[ A\vec{u} = \lambda \vec{u} \] for some \(\lambda\in\mathbb{R}\), then:
- \(\vec{u}\) is called an eigenvector of \(A\)
- \(\lambda\) is called an eigenvalue of \(A\)
- Geometric interpretation: \(A\) acts on \(\vec{u}\) by scaling it by \(\lambda\)
- Eigenvalues are found from the characteristic equation \(\det(A-\lambda I_n)=0\)
Exercise
- Let \(A=\begin{pmatrix}3 & 1\\0 & 2\end{pmatrix}\)
- Find the eigenvalues of \(A\)
- Enter your answer on iClicker
Scan the QR code or go to join.iclicker.com/MBNJ.
Exercise
- Let \(A=\begin{pmatrix}3 & 1\\0 & 2\end{pmatrix}\)
- The eigenvalues are \(\lambda_1=3\) and \(\lambda_2=2\)
- Find an eigenvector corresponding to \(\lambda_2=2\)
- Enter your answer on iClicker
Scan the QR code or go to join.iclicker.com/MBNJ.
Eigenbasis
- A basis \(\{\vec{u}_1,\dots,\vec{u}_n\}\) of \(\mathbb{R}^n\) is an eigenbasis of \(A\) if each \(\vec{u}_i\) is an eigenvector of \(A\)
- Geometric interpretation: \(A\) stretches each direction \(\vec{u}_i\) by \(\lambda_i\)
- In the coordinate system defined by \(\vec{u}_i\)’s, \(A\) behaves like a diagonal matrix
- Two important cases where an eigenbasis exists:
- \(A\) has \(n\) distinct eigenvalues
- \(A\) is symmetric (then an orthogonal/orthonormal eigenbasis exists)
- For other cases, an eigenbasis may or may not exist
Diagonalization
Setting
- Let \(A\) be an \(n\times n\) matrix
- Suppose that \(\{\vec{u}_1,\dots,\vec{u}_n\}\) is an eigenbasis of \(A\) with eigenvalues \(\lambda_1,\dots,\lambda_n\), i.e. \[ A\vec{u}_i=\lambda_i \vec{u}_i \]
- Then \(A\) acts like a diagonal matrix in the coordinate system defined by \(\{\vec{u}_1,\dots,\vec{u}_n\}\)
- Let \[ P=[\vec{u}_1 \ \cdots \ \vec{u}_n], \quad D=\operatorname{diag}(\lambda_1,\dots,\lambda_n) \]
Diagonalization
- The action of \(A\) can be understood in three steps:
- change coordinates using \(P^{-1}\) (so that each \(\vec{u}_i\) direction becomes \(\vec{e}_i\))
- apply the diagonal transformation \(D\)
- change back using \(P\)
- In matrix form: \[ A = PD P^{-1}, \quad \text{equivalently } D = P^{-1}AP \]
- This decomposition is called diagonalization, and in this case \(A\) is said to be diagonalizable
- In particular, every symmetric matrix is diagonalizable
- See a visualization
Example: diagonalization of a 2×2 matrix
- Let \(A=\begin{pmatrix}3 & 1\\0 & 2\end{pmatrix}\)
- Eigenvalues: \(\lambda_1=3\), \(\lambda_2=2\)
- Eigenvectors:
- for \(\lambda=3\): \(\vec{u}_1=\begin{pmatrix}1\\0\end{pmatrix}\)
- for \(\lambda=2\): \(\vec{u}_2=\begin{pmatrix}1\\-1\end{pmatrix}\)
- Then \[P=\begin{pmatrix}1 & 1\\0 & -1\end{pmatrix}, \quad D=\begin{pmatrix}3 & 0\\0 & 2\end{pmatrix}\]
- Compute \[P^{-1}=\begin{pmatrix}1 & 1\\0 & -1\end{pmatrix}^{-1} =\begin{pmatrix}1 & 1\\0 & -1\end{pmatrix}\]
- Hence \(A = PDP^{-1}\)
Applications
Matrix powers
- Let \(D=\operatorname{diag}(\lambda_1,\dots,\lambda_n)\) be a diagonal matrix
- Then it is very easy to compute powers: \[D^k=\operatorname{diag}(\lambda_1^k,\dots,\lambda_n^k)\]
- Reason: each standard basis direction is stretched by \(\lambda_i\), so applying \(D\) repeatedly stretches it \(k\) times, giving \(\lambda_i^k\)
- Now suppose \(A=PDP^{-1}\) is diagonalizable, so \(A\) stretches each eigenvector direction \(\vec{u}_i\) by \(\lambda_i\)
- Then applying \(A\) repeatedly should stretch \(\vec{u}_i\) by \(\lambda_i^k\)
- More formally: \[A^k = (PDP^{-1})^k = PD^kP^{-1}\]
Example
Let \[A=\begin{pmatrix}3 & 1\\0 & 2\end{pmatrix}\]
From earlier, \(A\) is diagonalizable with \[P=\begin{pmatrix}1 & 1\\0 & -1\end{pmatrix}, \quad D=\begin{pmatrix}3 & 0\\0 & 2\end{pmatrix}, \quad P^{-1}=\begin{pmatrix}1 & 1\\0 & -1\end{pmatrix}\]
Step 1: compute powers of \(D\) (easy) \[D^k=\begin{pmatrix}3^k & 0\\0 & 2^k\end{pmatrix}\]
Step 2: use diagonalization \[A^k = PD^kP^{-1}\]
Step 3: multiply \[PD^k=\begin{pmatrix}1 & 1\\0 & -1\end{pmatrix} \begin{pmatrix}3^k & 0\\0 & 2^k\end{pmatrix} =\begin{pmatrix}3^k & 2^k\\0 & -2^k\end{pmatrix}\] \[A^k = PD^kP^{-1} =\begin{pmatrix}3^k & 2^k\\0 & -2^k\end{pmatrix} \begin{pmatrix}1 & 1\\0 & -1\end{pmatrix} =\begin{pmatrix}3^k & 3^k-2^k\\0 & 2^k\end{pmatrix}\]
Final result: \[A^k=\begin{pmatrix}3^k & 3^k-2^k\\0 & 2^k\end{pmatrix}\]
Key idea: even though \(A\) is not diagonal, its powers are easy to compute because it behaves like \(D\) in the eigenvector coordinate system
Markov chains
- A transition matrix \(P\) describes one-step transition probabilities
- The matrix \(P^k\) describes transition probabilities after \(k\) steps
- If \(P\) is diagonalizable, say \(P=QDQ^{-1}\), then \[P^k=QD^kQ^{-1}\]
- So instead of multiplying \(P\) many times, we:
- diagonalize once
- reuse it to compute all powers efficiently
Fibonacci sequence (optional)
- The Fibonacci sequence is defined recursively by \[F_0=0,\quad F_1=1,\quad F_n=F_{n-1}+F_{n-2}\quad (n\ge 2)\]
- So each term is the sum of the previous two: \[0,\ 1,\ 1,\ 2,\ 3,\ 5,\ 8,\ 13,\dots\]
- We can rewrite this recursion as a matrix equation: \[\begin{pmatrix}F_{n+1}\\F_n\end{pmatrix} = \begin{pmatrix}1 & 1\\1 & 0\end{pmatrix} \begin{pmatrix}F_n\\F_{n-1}\end{pmatrix}\]
- Let \[A=\begin{pmatrix}1 & 1\\1 & 0\end{pmatrix}\] Then \[\begin{pmatrix}F_{n+1}\\F_n\end{pmatrix}=A^n\begin{pmatrix}1\\0\end{pmatrix}\]
- So finding a formula for \(F_n\) reduces to computing \(A^n\)
General formula for Fibonacci sequence
- To compute \(A^n\), diagonalize \[A=\begin{pmatrix}1 & 1\\1 & 0\end{pmatrix}\]
- The characteristic equation is \[\det(A-\lambda I)=\begin{vmatrix}1-\lambda & 1\\1 & -\lambda\end{vmatrix} =\lambda^2-\lambda-1=0\]
- Hence the eigenvalues are \[\lambda_1=\phi=\frac{1+\sqrt5}{2}, \qquad \lambda_2=\psi=\frac{1-\sqrt5}{2}\]
- Corresponding eigenvectors are \[\vec{u}_1=\begin{pmatrix}\phi\\1\end{pmatrix}, \qquad \vec{u}_2=\begin{pmatrix}\psi\\1\end{pmatrix}\]
- Therefore \[P=\begin{pmatrix}\phi & \psi\\1 & 1\end{pmatrix}, \quad D=\begin{pmatrix}\phi & 0\\0 & \psi\end{pmatrix}, \quad A=PDP^{-1}\]
- So \[A^n=PD^nP^{-1} = P\begin{pmatrix}\phi^n & 0\\0 & \psi^n\end{pmatrix}P^{-1}\]
- Applying this to the initial vector \(\begin{pmatrix}1\\0\end{pmatrix}\) gives \[\begin{pmatrix}F_{n+1}\\F_n\end{pmatrix}=A^n\begin{pmatrix}1\\0\end{pmatrix}\]
- After simplifying, we obtain the closed formula \[F_n=\frac{\phi^n-\psi^n}{\sqrt5}\]
- This is called Binet’s formula
Matrix exponential
- From calculus, recall the exponential function: \[e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots\]
- We extend this idea to matrices by replacing \(x^n\) with \(A^n\): \[e^A = \sum_{n=0}^\infty \frac{A^n}{n!} = I + A + \frac{A^2}{2!} + \frac{A^3}{3!} + \cdots\]
- Each term involves higher powers of \(A\), just like in the scalar case
- This definition is useful for solving systems of differential equations
Matrix exponential of diagonal matrices
- Let \(D=\operatorname{diag}(\lambda_1,\dots,\lambda_n)\)
- Since powers of \(D\) are easy to compute, we get \[e^D = I + D + \frac{D^2}{2!} + \cdots\]
- Each power remains diagonal: \[D^k=\operatorname{diag}(\lambda_1^k,\dots,\lambda_n^k)\]
- So the series becomes \[e^D=\operatorname{diag}\left(1+\lambda_1+\frac{\lambda_1^2}{2!}+\cdots,\ \dots,\ 1+\lambda_n+\frac{\lambda_n^2}{2!}+\cdots\right)\]
- Each diagonal entry behaves like the scalar exponential: \[e^D=\operatorname{diag}(e^{\lambda_1},\dots,e^{\lambda_n})\]
Matrix exponential of diagonalizable matrices
- If \(A=PDP^{-1}\), then \[e^A = I + A + \frac{A^2}{2!} + \cdots\]
- Substitute \(A=PDP^{-1}\) into each term: \[e^A = I + PDP^{-1} + \frac{PD^2P^{-1}}{2!} + \cdots\]
- Factor out \(P\) and \(P^{-1}\): \[e^A = P\left(I + D + \frac{D^2}{2!} + \cdots\right)P^{-1}\]
- Recognize the series inside as \(e^D\): \[e^A = Pe^DP^{-1}\]
- So computing \(e^A\) reduces to the diagonal case
- Intuition: everything happens independently along eigenvector directions
Examples
Let \[A=\begin{pmatrix}1 & 1\\0 & 2\end{pmatrix}\]
This matrix is diagonalizable with eigenvalues \(\lambda_1=1\) and \(\lambda_2=2\)
Corresponding eigenvectors are \[\vec{u}_1=\begin{pmatrix}1\\0\end{pmatrix}, \quad \vec{u}_2=\begin{pmatrix}1\\1\end{pmatrix}\]
Therefore \[P=\begin{pmatrix}1 & 1\\0 & 1\end{pmatrix}, \quad D=\begin{pmatrix}1 & 0\\0 & 2\end{pmatrix}, \quad P^{-1}=\begin{pmatrix}1 & -1\\0 & 1\end{pmatrix}\]
So the diagonalization is \[A=PDP^{-1}\]
First compute the exponential of the diagonal matrix: \[e^D=\begin{pmatrix}e & 0\\0 & e^2\end{pmatrix}\]
Then use diagonalization: \[e^A=Pe^DP^{-1}\]
Multiply: \[Pe^D=\begin{pmatrix}1 & 1\\0 & 1\end{pmatrix}\begin{pmatrix}e & 0\\0 & e^2\end{pmatrix} =\begin{pmatrix}e & e^2\\0 & e^2\end{pmatrix}\]
\[e^A=\begin{pmatrix}e & e^2\\0 & e^2\end{pmatrix}\begin{pmatrix}1 & -1\\0 & 1\end{pmatrix} =\begin{pmatrix}e & e^2-e\\0 & e^2\end{pmatrix}\]
- Final result: \[e^A=\begin{pmatrix}e & e^2-e\\0 & e^2\end{pmatrix}\]
